package com.cssy.authority.service;

import java.util.Date;
import java.util.List;
import java.util.Map;

import com.cssy.authority.entity.Organization;
import com.cssy.authority.entity.User;
import com.plat.exception.BaseException;



public interface IAuthorityService {

	public List<Organization> getAllOrgs() throws BaseException;
	/**
	 * 删除用户
	 * @param userid
	 * @return
	 * @throws BaseException
	 */
	public int delUser(String userid)throws BaseException;
	
	public List<User> getUserByCondition(Map map) throws BaseException;

	public List<User> getSelectUser(Map map);
	
	int getSelectUserCount(Map map);
	
	public User getByUserName(String name);
	/**
	 * 根据用户id来查询用户的入职时间
	 * @param id
	 * @return
	 */
	Date getEnterDate(long id);
	/**
	 * 根据用户id来获取员工的工号
	 * @param userId
	 * @return
	 * @throws BaseException
	 */
	String getUserStatffId(String userId) throws BaseException;
	
	int updateUser(User user) throws BaseException;
	User saveUser(User user)throws BaseException;
	Organization getOrganizationById(Long id ) throws BaseException;
	/**
	 * 获取给定日期的生日的员工
	 * @param date
	 * @return
	 * @throws BaseException
	 */
	List<User> getBirthdayUser(Date date) throws BaseException;
	/**
	 * 获取指定日期的合同到期员工信息
	 * @param date
	 * @return
	 * @throws BaseException
	 */
	List<User> getContractExpUser(Date date) throws BaseException;
	/**
	 * 获取需要转正的员工列表
	 * @param date
	 * @return
	 * @throws BaseException
	 */
	List<User> getToPositiveUser(Date date) throws BaseException;
	/**
	 * 冻结用户
	 * @param userId
	 * @throws BaseException
	 */
	void frozenUser(int userId) throws BaseException;
	/**
	 * 更新密码
	 * @param userId
	 * @param oldPassword
	 * @param newPassword
	 * @return
	 * @throws BaseException
	 */
	boolean updatePassword(long userId , String oldPassword , String newPassword) throws BaseException;
	/**
	 * 根据id来查找用户
	 * @param userId
	 * @return
	 * @throws BaseException
	 */
	User getUserById(long userId) throws BaseException;
	/**
	 * 用户登录统计
	 * @throws BaseException
	 */
	void userLogin(com.byd.acegiext.domain.User user) throws BaseException;
	
	/**
	 * 不需要关联角色，用于用户角色管理
	 * @param map
	 * @return
	 */
	List<User> getSelectUserNoRole(Map map);
	/**
	 * 不需要关联角色，用于用户角色管理
	 * @param map
	 * @return
	 */
	int getSelectUserCountNoRole(Map map);
}
